import Taro from '@tarojs/taro';
import { useEffect, useState } from 'react';
import { onNetworkStatusChange } from '@tarojs/taro';
export const useWatchNetwork = function () {
    const [isHasNetWork, setIsNetWork] = useState(true);
    useEffect(() => {
        onNetworkStatusChange(function (res) {
            setIsNetWork(res.isConnected);
        });
    }, []);
    return isHasNetWork;
};
